﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_TECHNIC_RATIO
// * CreateDate    : 2012-09-26 14:40:55
// * Creater       : CodeSmith
// * LastChangeDate: 2012-09-26 14:40:55
// * LastChanger   : 2012-09-26 14:40:55
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class ProdTechnicRatioEntity : EntityBase
    {
        public ProdTechnicRatioTable TableSchema
        {
            get
            {
                return ProdTechnicRatioTable.Current;
            }
        }

        public ProdTechnicRatioEntity()
        {

        }

        public ProdTechnicRatioEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.TechnicId = Convert.ToString(CommonFunctions.ToObject(dr["TECHNIC_ID"]));
            this.QtyFrom = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY_FROM"]));
            this.QtyTo = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY_TO"]));
            this.Ratio = Convert.ToDecimal(CommonFunctions.ToObject(dr["RATIO"]));
            this.ValidityFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["VALIDITY_FLAG"]));
        }

        public ProdTechnicRatioEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.TechnicId = Convert.ToString(CommonFunctions.ToObject(dr["TECHNIC_ID"]));
            this.QtyFrom = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY_FROM"]));
            this.QtyTo = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY_TO"]));
            this.Ratio = Convert.ToDecimal(CommonFunctions.ToObject(dr["RATIO"]));
            this.ValidityFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["VALIDITY_FLAG"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdTechnicRatioTable.Current;
            }
        }

        #region Perporty List
        public string Id
        {
            get { return Convert.ToString(GetData(ProdTechnicRatioTable.C_ID)); }
            set { SetData(ProdTechnicRatioTable.C_ID, value); }
        }

        public string TechnicId
        {
            get { return Convert.ToString(GetData(ProdTechnicRatioTable.C_TECHNIC_ID)); }
            set { SetData(ProdTechnicRatioTable.C_TECHNIC_ID, value); }
        }

        public decimal QtyFrom
        {
            get { return Convert.ToDecimal(GetData(ProdTechnicRatioTable.C_QTY_FROM)); }
            set { SetData(ProdTechnicRatioTable.C_QTY_FROM, value); }
        }

        public decimal QtyTo
        {
            get { return Convert.ToDecimal(GetData(ProdTechnicRatioTable.C_QTY_TO)); }
            set { SetData(ProdTechnicRatioTable.C_QTY_TO, value); }
        }

        public decimal Ratio
        {
            get { return Convert.ToDecimal(GetData(ProdTechnicRatioTable.C_RATIO)); }
            set { SetData(ProdTechnicRatioTable.C_RATIO, value); }
        }

        public int ValidityFlag
        {
            get { return Convert.ToInt32(GetData(ProdTechnicRatioTable.C_VALIDITY_FLAG)); }
            set { SetData(ProdTechnicRatioTable.C_VALIDITY_FLAG, value); }
        }

        #endregion
    }


}

